import Taro from '@tarojs/taro'
import { create } from 'zustand'

console.log(create, 1111111)

interface SystemState {
  CapsuleHeight: number
  CapsuleTop: number
  NavHeight: () => number
}

export const useSystemStore = create<SystemState>((set, get) => {
  CapsuleHeight: Taro.getMenuButtonBoundingClientRect().height
  CapsuleTop: Taro.getMenuButtonBoundingClientRect().top
  NavHeight: () => {
    const { CapsuleHeight, CapsuleTop } = get()
    return CapsuleTop + CapsuleHeight
  }
})
